<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sp" uri="http://www.springframework.org/tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>My JSP 'add.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
<meta http-equiv="description" content="This is my page" />
<link rel="stylesheet" type="text/css" href="/css/reset.css" />
<link rel="stylesheet" type="text/css" href="/css/common.css" />
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/formcheck/formcheck-0.0.1.js"></script>
</head>

<body class="mainframe">

  <a id="root_articleCatalog_add" class="button01" href="/admin/articleCatalog/add.dhtml?articleCatalog.parentId=<c:out value="${articleCatalog.id }" />" target="articleCatalog_edit">添加一级菜单</a>
  <form id="articleCatalogForm" action="/admin/articleCatalog/edit.dhtml" method="post">
    <input type="hidden" name="articleCatalog.id" value="<c:out value="${articleCatalog.id }" />" />
    <table class="admin_table">
      <caption>修改新闻目录</caption>
      <c:choose>
        <c:when test="${message.info != null }">
          <tr>
            <td colspan="2"><sp:message code="${message.info}" text="" /></td>
          </tr>
        </c:when>
        <c:otherwise>
          <tr>
            <td>名称</td>
            <td><input id="articleCatalogName" type="text" name="articleCatalog.name" value="<c:out value="${articleCatalog.name }" />" /><span id="articleCatalogNameTip"></span></td>
          </tr>
          <tr>
            <td>描述</td>
            <td><input id="articleCatalogNote" type="text" name="articleCatalog.note" value="<c:out value="${articleCatalog.note }" />" /></td>
          </tr>
          <tr>
            <td></td>
            <td><input type="submit" class="button01" id="submit_articleCatalog" value="修改" /></td>
          </tr>
        </c:otherwise>
      </c:choose>
    </table>
  </form>

  <script type="text/javascript">
		window.parent.loadMenuTree();
		$(document).ready(function() {
		});

		$(document).ready(function() {
			// 表单验证
			var formCheck = $.formCheck();
			formCheck.regAllEmpty("articleCatalogName", {
				onShow : "输入目录名称",
				onFocus : "此项为必填",
				onError : "此项为必填",
				onCorrect : "目录名称输入正确"
			}, true);
			formCheck.regAllEmpty("articleCatalogUrl", {
				onShow : "输入链接",
				onFocus : "此项为必填",
				onError : "此项为必填",
				onCorrect : "链接输入正确"
			}, true);
			formCheck.formCheck("articleCatalogForm");
		});
	</script>
</body>
</html>